import request from '@/utils/request';
import { stringify } from 'qs';
//群列表
export async function crowdList(params) {
  return request(`/api/admin/crowd/list?${stringify(params)}`);
}

export async function crowddel(params) {
  return request(`/api/admin/crowd/del`, {
    method: 'POST',
    body: {
      id: params.id,
    },
  });
}

export async function updateCrowdInfo(params) {
  return request('/api/admin/crowd/update', {
    method: 'POST',
    body: params,
  });
}

export async function corwdInfo(params) {
  return request('/api/admin/login', {
    method: 'POST',
    body: params,
  });
}
//文章列表
export async function crowdarticlelist(params) {
  return request(`/api/admin/article/list?${stringify(params)}`, {
    method: 'get',
  });
}
//删除文章
export async function crowdarticledel(params) {
  return request(`/api/admin/article/delarticle`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}
//修改文章
export async function crowdupdatearticle(params) {
  return request(`/api/admin/article/uparticle`, {
    method: 'POST',
    body: {
      ...params,
    },
  });
}

export async function crowdActivityList(params) {
  return request(`/api/admin/activity/list?${stringify(params)}`);
}

export async function crowdActivityUpdate(params) {
  return request('/api/admin/activity/update', {
    method: 'POST',
    body: params,
  });
}

export async function crowdActivityDelete(params) {
  return request('/api/admin/activity/del', {
    method: 'POST',
    body: params,
  });
}

export async function crowdActivityAdd(params) {
  return request('/api/admin/activity/add', {
    method: 'POST',
    body: params,
  });
}

//添加文章
export async function crowdaddarticle(params) {
  return request(`/api/admin/article/savearticle`, {
    method: 'POST',
    body: params,
  });
}

//动态列表
export async function crowdtopiclist(params) {
  return request(`/api/admin/topic/topstick`, {
    method: 'POST',
    body: params,
  });
}

//动态删除
export async function deletetopic(parms) {
  return request(`/api/admin/topic/deltopic`, {
    method: 'POST',
    body: parms,
  });
}

export async function crowdClassList(params) {
  return request(`/api/admin/crowd/class?${stringify(params)}`);
}

export async function crowdClassRemove(parms) {
  return request(`/api/admin/crowd/class/remove`, {
    method: 'POST',
    body: parms,
  });
}

export async function crowdClassUpdate(parms) {
  return request(`/api/admin/crowd/class/update`, {
    method: 'POST',
    body: parms,
  });
}

export async function crowdClassAdd(parms) {
  return request(`/api/admin/crowd/class/add`, {
    method: 'POST',
    body: parms,
  });
}
